﻿using System;
using UnityEngine;
using UnityEngine.EventSystems;

namespace UniRx.Triggers
{
	// Token: 0x02000440 RID: 1088
	[DisallowMultipleComponent]
	public class ObservableSelectTrigger : ObservableTriggerBase, IEventSystemHandler, ISelectHandler
	{
		// Token: 0x060016D5 RID: 5845 RVA: 0x000626F8 File Offset: 0x00060AF8
		void ISelectHandler.OnSelect(BaseEventData eventData)
		{
			if (this.onSelect != null)
			{
				this.onSelect.OnNext(eventData);
			}
		}

		// Token: 0x060016D6 RID: 5846 RVA: 0x00062714 File Offset: 0x00060B14
		public IObservable<BaseEventData> OnSelectAsObservable()
		{
			Subject<BaseEventData> result;
			if ((result = this.onSelect) == null)
			{
				result = (this.onSelect = new Subject<BaseEventData>());
			}
			return result;
		}

		// Token: 0x060016D7 RID: 5847 RVA: 0x0006273C File Offset: 0x00060B3C
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.onSelect != null)
			{
				this.onSelect.OnCompleted();
			}
		}

		// Token: 0x04000CC2 RID: 3266
		private Subject<BaseEventData> onSelect;
	}
}
